package com.liziba.trend.eurekaserver;

import cn.hutool.core.util.NetUtil;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;

/**
 * @ProjectName: trend-parent
 * @Package: com.liziba.trend.eurekaserver
 * @ClassName: EurekaServerApplication_8761
 * @Author: liziba
 * @Description: eureka注册中心启动类
 * @Date: 2021/2/1 14:37
 * @Version: 1.0
 */
@SpringBootApplication
@EnableEurekaServer
public class EurekaServerApplication_8761 {
    public static void main(String[] args) {
        // eureka 默认端口号
        int port = 8761;
        if(!NetUtil.isUsableLocalPort(port)) {
            System.err.printf("端口号%d被占用，无法启动！", port);
            System.exit(1);
        }
        new SpringApplicationBuilder(EurekaServerApplication_8761.class).properties("server.port=" + port).run(args);
    }
}
